package com.qf.boot1.mapper;

import com.qf.boot1.entity.District;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * @author zed
 * @date 2022/5/18 17:09
 * 使用注解的方式可以替换之前的mapper.xml文件
 * select insert update delete 语句
 * 现在是把上面的语句写到注解中了
 */
public interface DistrictMapper {

    @Insert("insert into district(name) VALUES(#{name})")
    int add(District district);

    @Delete("delete from district where id=#{id}")
    int delete(@Param("id") Integer id);

    @Select("select * from district where id=#{id}")
    District selectOne(Integer id);
}
